/*
 * calculsoustableau.h
 *
 *  Created on: 11 nov. 2011
 *      Author: pierre
 */

#ifndef CALCULSOUSTABLEAU_H_
#define CALCULSOUSTABLEAU_H_
#include <stdlib.h>
#include <string>
#include <iostream>
#include <vector>
#include "tbb/tbb.h"

using namespace std;

struct result{
    std::string nfichier;
    int x0,y0,x1,y1;
    int m;
};

class calcule: public tbb::task{
    public :
        vector<int> *cgh;
        int x0;
        int x1;
        struct result *resultatfinal;
        calcule(vector<int> *cgh_,int x0_,int x1_,struct result *resultatfinal_);
        void calculSousTableau (vector<int> *cgh,int x0,int x1,struct result *resultatfinal);
        tbb::task* execute();
};
class calcule1: public tbb::task {
    public :
        vector<int> *cgh;
        vector<int> *psum;
        vector<int> *smax;
        calcule1( vector<int> *cgh_,vector<int> *psum_,vector<int> *smax_);
        void calc_psum(vector<int> *cgh,vector<int> *psum);
        void calc_smax(vector<int> *psum,vector<int> *smax);
        tbb::task* execute();
};
class calcule2: public tbb::task {
    public :
        vector<int> *cgh;
        vector<int> *ssum;
        vector<int> *pmax;
        void calc_ssum(vector<int> *cgh,vector<int> *ssum);
        void calc_pmax(vector<int> *ssum,vector<int> *pmax);
        calcule2( vector<int> *cgh_,vector<int> *ssum_,vector<int> *pmax_);
        tbb::task* execute();
};
class calculefinal{
    public :
    int calculM(int *y0,int *y1,vector<int> *cgh,vector<int> *ssum,vector<int> *psum,vector<int> *pmax,vector<int> *smax,vector<int> *m);
};





#endif /* CALCULSOUSTABLEAU_H_ */

